package org.example.springbootpra1.demos.services.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.springbootpra1.demos.bean.ChargingPile;
import org.example.springbootpra1.demos.mapper.ChargePileMapper;
import org.example.springbootpra1.demos.services.service.ChargePileService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ChargePileServiceImpl extends ServiceImpl<ChargePileMapper, ChargingPile> implements ChargePileService {

    @Autowired
    private ChargePileMapper chargePileMapper;

    @Override
    public IPage<ChargingPile> getChargingPilePage(){
        Page<ChargingPile> page = new Page<>(1, 5);

       return chargePileMapper.selectPage(page, new LambdaQueryWrapper<>());

    }


    @Override
    public IPage<ChargingPile> getChargingPileQueryPage(Page<ChargingPile> page, QueryWrapper<ChargingPile> queryWrapper){
        return chargePileMapper.selectPage(page, queryWrapper);

    }


}
